package com.zhm.demo.utils;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@NoArgsConstructor
@Data
public class GeoJson {


    @JsonProperty("type")
    private String type = "FeatureCollection";

    @JsonProperty("features")
    private List<FeaturesDTO> features;

    @NoArgsConstructor
    @Data
    public static class FeaturesDTO {
        @JsonProperty("type")
        private String type;

        @JsonProperty("properties")
        private Map<String,Object> properties; //name,id

        @JsonProperty("geometry")
        private GeometryDTO geometry;

        @NoArgsConstructor
        @Data
        public static class GeometryDTO {

            @JsonProperty("coordinates")
            private List<Object> coordinates; // Polygon LineString List<[lat,lng]> // Point[lat,lng]

            @JsonProperty("type")
            private String type; //Point Polygon LineString
        }
    }
}
